package com.yao.controller;

import com.yao.pojo.ManageFinances;
import com.yao.pojo.User;
import com.yao.service.FinanceService;
import com.yao.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 妖悲冥
 * @date 2021/5/16 0016   -    8:39
 */

@CrossOrigin
@RestController
@RequestMapping("/finances")
public class FinanceController {
    @Autowired
    FinanceService financeService;

    @RequestMapping("/selectFinances")
    public List<String> selectFinances(@RequestBody ManageFinances finances) {
        return financeService.selectFinances(finances);
    }

    @RequestMapping("/addFinances")
    public String addFinances(@RequestBody ManageFinances finances) {
        return financeService.addFinances(finances);
    }

    @RequestMapping("/deleteFinances")
    String deleteFinances(@RequestBody ManageFinances finances) {
        return financeService.deleteFinances(finances);
    }
}
